<template>
  <div>
    <el-table :data="lists" border style="width: 100%">
      <el-table-column prop="id" label="#" width="180" />
      <el-table-column prop="authName" label="名称" width="180" />
      <el-table-column prop="path" label="路径" />
      <el-table-column prop="level" label="权限等级">
        <template #default="scope">
          <el-tag class="ml-2" type="danger" v-if="scope.row.level==0">1级权限</el-tag>
          <el-tag class="ml-2" type="success" v-if="scope.row.level==1">2级权限</el-tag>
          <el-tag class="ml-2" type="warning" v-if="scope.row.level==2">3级权限</el-tag>
          
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>


<script setup>
import { ref } from 'vue';
let lists = ref([])
import { getRightsList } from "../../api/role";
let list = async () => {
  let res = await getRightsList('list')
  console.log(res);
  lists.value = res.data.data
}
list()
</script>


<style>
</style>